using System.Data.Entity.ModelConfiguration;
using Nop.Core.Domain.ShareBuy;

namespace Nop.Data.Mapping.ShareBuy
{
    public partial class ShareBuyCommentMap : EntityTypeConfiguration<ShareBuyComment>
    {
        public ShareBuyCommentMap ()
        {
            this.ToTable("ShareBuyComment");
            //commented because it's already configured by CustomerContentMap class
            //this.HasKey(pp => pp.Id);

            this.Property(pp => pp.CommentText).IsMaxLength();

            this.HasRequired(pp => pp.ShareBuyItem)
                .WithMany(c => c.ShareBuyComments)
                .HasForeignKey(pp => pp.ShareBuyItemId);
        }
    }
}